import shortid from 'shortid';

const IdGenerator = {};

IdGenerator.generate = function (input) {
    let output = {};
    if (input instanceof Array) {
        for (let i of input) {
            if (typeof i !== 'string') {
                continue;
            }
            output[i] = shortid.generate();
        }
        return output;
    }
    return shortid.generate();
}

export default IdGenerator;